package models

import (
	"gin-app/app/common"
)

// Novel 书籍模型
type Novel struct {
	common.ID
	Name         string `json:"book_name" gorm:"size:100;comment:书籍名称"`
	Author       string `json:"author" gorm:"size:100;comment:作者名称"`
	Cover        string `json:"cover" gorm:"size:255;comment:书籍封面"`
	Description  string `json:"description" gorm:"type:text;comment:书籍描述"`
	CreateUserId string `json:"create_user_id" gorm:"size:100;comment:创建者id"`
	common.Timestamps
	common.SoftDeletes
}

func NewNovel(name, author, cover, description, CreateUserId string) *Novel {
	return &Novel{
		Name:         name,
		Author:       author,
		Cover:        cover,
		Description:  description,
		CreateUserId: CreateUserId,
	}
}
